home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-10-15 | 23.7 KB | 895 lines | [TEXT/MPS ] |
- /*
- * File: RequestDispatcher.cp
- *
- * Contains: xxx put contents here xxx
- *
- * Written by: Rick Violet
- *
- * Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
- *
- * Change History (most recent first):
- *
- * <1+> 8/30/93 RV Add ReadVersion service
- * <6> 7/8/93 RV Fix DoGetToolServices not to drop last service name
- * <5+> 7/8/93 RV Fix DoGetToolServices not to drop last service name
- * <2> 4/15/93 RV Fix Memory Leak in DispatchCustomRequest
- * <1+> 4/15/93 RV Fix Memory Leak in DispatchCustomRequest
- * 11/18/92 RV xxx put comment here xxx
- *
- * To Do:
- */
-
- #ifdef THINK_CPLUS
- #ifndef __Strings__
- #include <String.h>
- #endif
- #else
- #include <Strings.h>
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __GESTALTEQU__
- #include <GestaltEqu.h>
- #endif
-
- #ifndef __Application__
- #include "Application.h"
- #endif
-
- #ifndef __RequestDispatcher__
- #include "RequestDispatcher.h"
- #endif
-
- #ifdef __AERequest__
- #include "AERequest.h"
- #endif
-
- #ifndef __StandardServices__
- #include "StandardServices.h"
- #endif
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // Global Variables
- //—————————————————————————————————————————————————————————————————————————————————————
- RequestDispatcher* gTheRequestDispatcher;
- extern Application* gTheApplication;
-
- extern ThreadID gRequestDispatcherThreadID;
-
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // External Routines
- //—————————————————————————————————————————————————————————————————————————————————————
- extern void TerminalError(short errResID, short errCode);
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::RequestDispatcher - constructor.
- //—————————————————————————————————————————————————————————————————————————————————————
- RequestDispatcher::RequestDispatcher()
- {
- fRequestQueue = nil;
- fServices = nil;
-
- //———— Construct a Queue for incoming requests
- fRequestQueue = new List();
- if( fRequestQueue == nil )
- {
- TerminalError( kDispatcherErrStrings, kReqQueueConstructErr );
- }
-
- //———— Construct a Queue for Services
- fServices = new List();
- if( fServices == nil )
- {
- TerminalError( kDispatcherErrStrings, kServQueueConstructErr );
- }
-
- /*SBR Hacked this in 10/16/94 */
- //———— Construct a List for currently active Requests
- fActiveRequestList = new List();
- if( fActiveRequestList == nil )
- {
- TerminalError( kDispatcherErrStrings, kServQueueConstructErr );
- }
-
- //———— Install all the Request Handlers
- ConstructAllServiceObjects();
- ConstructServicesMenu();
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::~RequestDispatcher - destructor.
- //—————————————————————————————————————————————————————————————————————————————————————
- RequestDispatcher::~RequestDispatcher()
- {
- //———— Delete all the Queued Requests
- if( fRequestQueue )
- {
- fRequestQueue->DisposeAll();
- delete fRequestQueue;
- }
-
- /*SBR Hacked this in 10/16/94 */
- //———— Delete all the Active Requests
- if( fActiveRequestList )
- {
- fActiveRequestList->DisposeAll();
- delete fActiveRequestList;
- }
-
- //———— Delete all the Service Objects
- if( fServices )
- {
- fServices->DisposeAll();
- delete fServices;
- }
-
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::ConstructAllServices - Install all the Service objects.
- //
- // This method calls the constructor for each Request handler
- // and installs a pointer to it in the Queue of Services
- //
- // You must construct and install your Custom Request Handlers here
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::ConstructAllServiceObjects()
- {
- Service* tService;
-
- //———— if the List for containing the services does not exist,
- //———— bail out so we don't crash.
- if( fServices == nil )
- {
- return;
- }
-
- //———— Construct the threaded service object : EchoThreadService
- tService = new EchoThreadService();
- if( tService )
- {
- fServices->AddAsLast( tService );
- }
-
- //———— Construct the non-threaded service object : EchoNoThreadService
- tService = new EchoNoThreadService();
- if( tService )
- {
- fServices->AddAsLast( tService );
- }
-
- //———— Construct the non-threaded service object : SetSleepTicksService
- tService = new SetSleepTicksService();
- if( tService )
- {
- fServices->AddAsLast( tService );
- }
-
- }
-
- /*SBR Hacked this in 05/23/94 from VUAid 2.0b2 by Jon Marsh*/
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::ConstructServicesMenu - Create a menu listing installed services.
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::ConstructServicesMenu()
- {
- Loop* tLoop;
- Service* tService;
- ScriptValue* tServiceName;
- MenuHandle servicesMenu;
- char serviceNameText[256];
-
- servicesMenu = GetMenu(kServicesMenuID);
- tLoop = new Loop( fServices );
- if( tLoop )
- {
- while ( tService = (Service*)(tLoop->GetNext()) )
- {
- tServiceName = tService->GetServiceNameText();
- if( tServiceName )
- {
- strcpy (serviceNameText, ((VUString *) tServiceName)->GetText());
- C2PStr(serviceNameText);
- AppendMenu(servicesMenu, (ConstStr255Param) serviceNameText);
- }
- }
- delete tLoop;
- }
-
- }
-
- /*SBR Hacked this in 10/16/94 */
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoRequests - Process pending Requests in the queue.
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoRequests()
- {
- OSErr tErr = noErr;
- Request* tReq;
-
- // loop and handle requests as they appear in the pending request queue
- while (true)
- {
- //———— Reset any Apple event timeout counters which need it
- //———— Don't allow selfish services to cause others to time out
- ResetAllTimeOutCounters();
-
- //———— Is there an element in the pending Request Queue?
- if( ( fRequestQueue != nil ) && ( fRequestQueue->Count() > 0 ) )
- {
- //———— Extract the "oldest" Request from the Queue
- //———— New ones are added to the end by the application object
- tReq = (Request*)fRequestQueue->GetFirst();
-
- //———— if we got a Request object
- if( tReq )
- {
- //———— remove the request from the pending request queue
- fRequestQueue->Remove( tReq );
-
- //———— put the request into the active request list
- fActiveRequestList->AddAsLast( tReq );
-
- //———— If request was canceled, do not process it.
- if( tReq->HasBeenCanceled() )
- {
- RequestIsDone( tReq );
- }
- else
- {
- ProcessRequest( tReq );
-
- //———— When ProcessRequest returns, the request is either
- //———— canceled or done (not threaded), or ready in a new
- //———— thread. If canceled or done, complete the request.
- //———— If the request is a new thread, yield to it.
- if( tReq->IsThreaded() && gTheApplication->IsThreaded() )
- {
- //———— yield to the thread just created
- YieldToThread( tReq->GetThreadID() );
- }
- else
- {
- RequestIsDone( tReq );
- }
- }
-
- }
- }
- else if( gTheApplication->IsThreaded() )
- {
- //———— App is threaded and no new requests means give up time.
- //———— This *must* be a yield to any, not a specific yield,
- //———— to give time to active threads.
- YieldToAnyThread();
- }
- else
- {
- //———— no requests and not threaded means just return
- return;
- }
- }
- }
-
-
- /*SBR Hacked this in 10/16/94 */
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::RequestIsDone - completion routine for ProcessRequest thread
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::RequestIsDone( Request* pReq )
- {
- //———— send the result back to the caller
- pReq->SendResult();
-
- //———— request is no longer active
- fActiveRequestList->Remove( pReq );
-
- //———— Reset the cursor, so beach ball is not left there
- InitCursor();
-
- delete pReq;
-
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::QueueRequest - Puts a Request into our Queue
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::QueueRequest( Request* pReq )
- {
- //———— if this is a request to cancel a service request,
- //———— then find the service request and cancel it
- if( pReq->IsACancelRequest() )
- {
- DoCancelReq( pReq );
- delete pReq;
- }
- else
- {
- //———— This is not a request to cancel a service request
- //———— so queue it up, for processing later
- if( fRequestQueue != nil )
- {
- fRequestQueue->AddAsLast( pReq );
- }
- }
- }
-
- /*SBR Hacked this in 10/16/94 */
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::CancelAllRequests - Cancel processing of all requests
- //—————————————————————————————————————————————————————————————————————————————————————
- Boolean
- RequestDispatcher::CancelAllRequests()
- {
- Loop* tLoop;
- Request* tReq;
-
- //———— Cancel all pending Requests
- tLoop = new Loop( fRequestQueue );
- if( tLoop )
- {
- tReq = (Request*)(tLoop->GetNext());
- while( tReq )
- {
- tReq->CancelThisRequest();
- tReq = (Request*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— Cancel all active Requests
- tLoop = new Loop( fActiveRequestList );
- if( tLoop )
- {
- tReq = (Request*)(tLoop->GetNext());
- while( tReq )
- {
- tReq->CancelThisRequest();
- tReq = (Request*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— Any Requests left in the Pending Request Queue?
- if( ( fRequestQueue != nil ) && ( fRequestQueue->Count() > 0 ) )
- {
- return false;
- }
-
- //———— Any Requests left in the Active Request List?
- if( ( fActiveRequestList != nil ) && ( fActiveRequestList->Count() > 0 ) )
- {
- return false;
- }
-
- //———— No more Requests anywhere, cancelling is complete
- return true;
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::ProcessRequest - Process the Request
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::ProcessRequest( Request* pReq )
- {
- char* tServiceName;
-
- //———— Get the Text of the Service requested
- tServiceName = pReq->GetWhichService();
-
- //———— Check for ServiceSupported request
- if( relstring( tServiceName, (char*)kVUAEHasService, false, true ) == 0 )
- {
- DoServiceSupportedReq( pReq );
- return;
- }
-
- //———— Check for GetToolVersion request
- if( relstring( tServiceName, (char*)kVUAEGetToolVersion, false, true ) == 0 )
- {
- DoGetToolVersReq( pReq );
- return;
- }
-
- //———— Check for GetToolServices request
- if( relstring( tServiceName, (char*)kVUAEGetServiceList, false, true ) == 0 )
- {
- DoGetToolServicesReq( pReq );
- return;
- }
-
- //———— Check for Initialize request
- if( relstring( tServiceName,(char*)kVUAEInitialize, false, true ) == 0 )
- {
- DoInitializeReq( pReq );
- return;
- }
-
- //———— Check for Quit request
- if( relstring( tServiceName,(char*)kVUAEQuitService, false, true ) == 0 )
- {
- gTheApplication->DoMenuCommand( kFileMenuID, kQuitItem );
- return;
- }
-
- DispatchCustomRequest( pReq );
-
- return;
-
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoCancelReq - do the cancel Request
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoCancelReq( Request* pReq )
- {
- Loop* tLoop;
- Request* tReq;
-
- /*SBR Hacked this in 10/16/94 */
- //———— First check the Active Request List for the Request to cancel.
- tLoop = new Loop( fActiveRequestList );
- if( tLoop )
- {
- tReq = (Request*)(tLoop->GetNext());
- while( tReq )
- {
- //———— Is this the Service Object to be canceled?
- if( tReq->IsCancelRequestForThisRequest( pReq ) )
- {
- tReq->CancelThisRequest();
- delete tLoop;
- return;
- }
- tReq = (Request*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
-
- //———— Now check the Pending Request Queue for the Request to cancel.
- tLoop = new Loop( fRequestQueue );
- if( tLoop )
- {
- tReq = (Request*)(tLoop->GetNext());
- while( tReq )
- {
- //———— Is this the Service Object to be canceled?
- if( tReq->IsCancelRequestForThisRequest( pReq ) )
- {
- tReq->CancelThisRequest();
- delete tLoop;
- return;
- }
- tReq = (Request*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— If the Request was not found, then it was either never received,
- //———— or was completed and returned before the cancel request
- //———— arrived. In either case, just return an empty return value.
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoGetToolVersReq - return the version information
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoGetToolVersReq( Request* pReq )
- {
- VUList* tReturnList;
- char tText[256];
-
- tReturnList = new VUList();
- if( tReturnList )
- {
- //———— Get the Tool's Name
- GetToolName( tText );
- tReturnList->PutNthItem( tText );
-
- //———— Get the Tool's Version String
- GetToolVersionString( tText );
- tReturnList->PutNthItem( tText );
-
- pReq->SetReturnValue( tReturnList );
- }
- else
- {
- pReq->SetErrorCode( memFullErr );
- pReq->SetErrorMessage( "Out of memory?" );
- }
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoInitializeReq - pass initialize message to all services
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoInitializeReq( Request* pReq )
- {
- Loop* tLoop;
- Service* tService;
-
- //———— Scan through the Service objects,
- //———— and inform it that we have received an initialize message
- tLoop = new Loop( fServices );
- if( tLoop )
- {
- tService = (Service*)(tLoop->GetNext());
- while( tService )
- {
- //———— Call the initialize method for the service object
- tService->Initialize( pReq );
- tService = (Service*)(tLoop->GetNext());
- }
- }
- delete tLoop;
-
- if( gTheApplication->IsThreaded() )
- pReq->SetReturnValue( "threading enabled" );
- else
- pReq->SetReturnValue( "threading disabled" );
- }
-
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DispatchCustomRequest - execute a custom Request
- // This version executes non-threaded services in the RequestDispatcher thread,
- // which causes a problem for a quit request during a long non-threaded
- // service. Since the RequestDispatcher thread is looping in the custom code, it
- // never sees the quit request in the pending request queue. This is desirable
- // to block new custom service requests, but is not ideal for services like Quit.
- // This behavior is the same as the 2.0 non-threaded model -- to quit the tool in
- // the middle of a long asynchronous non-threaded service, you have to cancel
- // the service, then quit. Threaded services do not have this problem.
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DispatchCustomRequest( Request* pReq )
- {
- Loop* tLoop;
- Service* tService;
- char* tServiceName;
- Str255 tErrMessage;
-
- //———— Get the Text of the Service requested
- tServiceName = pReq->GetWhichService();
-
- if( fServices == nil )
- {
- //———— no Service queue object, bail out
- return;
- }
-
- tLoop = new Loop( fServices );
- if( tLoop )
- {
- tService = (Service*)(tLoop->GetNext());
- while( tService )
- {
- //———— Is this the Service object which can handle this request?
- if( tService->CanDoService( tServiceName ) )
- {
- //———— This is the correct Service object,
- //———— tell it to process the Request object.
-
- //———— Store a pointer to the Service in the Request
- pReq->SetService( tService );
-
- //———— Is it a threaded Service?
- if( tService->IsThreaded() )
- {
- if( gTheApplication->IsThreaded() )
- {
- CreateNewRequestThread( pReq );
- }
- else
- {
- //———— This threaded service can not be processed
- //———— because Thread Manager is not present
- pReq->SetErrorCode( errAEThreadsNotPresent );
- GetIndString( tErrMessage, kDispatcherErrStrings,
- kThreadsNotPresentErr );
- pReq->SetErrorMessage( p2cstr( tErrMessage ) );
- }
-
- }
- else
- {
- tService->ProcessRequest( pReq );
- }
-
- //———— Reset the cursor, so beach ball is not left there
- InitCursor();
- delete tLoop;
- return;
- }
- tService = (Service*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— The service which handles this request was not found
- //———— Report error and return
- pReq->SetErrorCode( errAEUnknownService );
- pReq->SetErrorMessage( "Service not found" );
- }
-
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::CreateNewRequestThread - ThreadedService::ProcessRequest()
- //—————————————————————————————————————————————————————————————————————————————————————
- OSErr
- RequestDispatcher::CreateNewRequestThread( Request* pReq )
- {
- //———— We are going to process a request for a Service.
- //———— Create the ProcessRequest thread as suspended,
- //———— so we can add it to the queue before yielding.
-
- ThreadedService* tService;
- OSErr tErr;
- ThreadID tRequestThread;
-
- tService = (ThreadedService*)(pReq->GetService());
-
- tErr = NewThread
- ( kCooperativeThread,
- (ThreadEntryProcPtr)&ServiceProcessRequestThread,
- pReq,
- tService->GetStackSize(),
- tService->GetThreadOptions(),
- 0,
- &tRequestThread
- );
-
- if ( tErr )
- {
- DebugStr( "\pError creating ServiceProcessRequestThread thread." );
- return tErr;
- }
-
- //———— make the new request thread
- tErr = SetThreadState( tRequestThread, kReadyThreadState, kNoThreadID );
- if ( tErr )
- {
- DebugStr( "\pError setting SetThreadState of tRequestThread to kReadyThreadState." );
- return tErr;
- }
-
- //———— store the request's ThreadID
- pReq->SetThreadID( tRequestThread );
-
- return noErr;
- }
-
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoGetToolServicesReq - return the list of Request names
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoGetToolServicesReq( Request* pReq )
- {
- Loop* tLoop;
- VUList* tReturnList;
- Service* tService;
- ScriptValue* tReturnNames;
- ScriptValue* tVal;
- char* tText;
- ValueKind tVKind;
- short tLastElement;
- short i;
-
- tReturnList = new VUList();
-
- if( tReturnList )
- {
- //———— Scan through the Service objects, and collect the
- //———— text of the service names which this tool supports
- tLoop = new Loop( fServices );
- if( tLoop )
- {
- tService = (Service*)(tLoop->GetNext());
- while( tService )
- {
- //———— Get the service's Name text
- //———— and append it to the list
- tReturnNames = tService->GetServiceNameText();
- if( tReturnNames )
- {
- switch( tReturnNames->GetValueKind() )
- {
- case kVUListKind:
- {
- tLastElement = ((VUList*)tReturnNames)->GetCount();
- for( i = 1; i <= tLastElement; i++ )
- {
- tVKind = kVUStringKind;
- ((VUList*)tReturnNames)->GetNthItem( i, tVal, tVKind );
- if( tVal )
- {
- tText = ((VUString*)tVal)->GetText();
- tReturnList->PutNthItem( tText );
- }
- }
- }
- break;
-
- default:
- {
- tText = ((VUString*)tReturnNames)->GetText();
- tReturnList->PutNthItem( tText );
- }
- break;
-
- }
- delete tReturnNames;
- }
- tService = (Service*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— We have tranversed the entire list of service objects
- //———— and collected each service's name into the list
- //———— now return the list to V.U.
- pReq->SetReturnValue( tReturnList );
- }
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::DoServiceSupportedReq - return the list of Request names
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::DoServiceSupportedReq( Request* pReq )
- {
- Loop* tLoop;
- Service* tService;
- char* tSrvText;
- OSErr tErr;
-
- /*SBR Hacked this in 05/23/94 */
- tErr = pReq->ExtractValueFromNthParam( 1, &tSrvText );
- if( tErr )
- {
- return;
- }
-
- //———— Scan through the Service objects, and inquire if any
- //———— supports the indicated service
- tLoop = new Loop( fServices );
- if( tLoop )
- {
- tService = (Service*)(tLoop->GetNext());
- while( tService )
- {
- //———— Ask service object if it can do this service,
- if( tService->CanDoService( tSrvText ) )
- {
- //———— We have found a service object which can handle this
- //———— request type, return true to V.U.
- pReq->SetReturnValue( true );
- return;
- }
- tService = (Service*)(tLoop->GetNext());
- }
- delete tLoop;
- }
-
- //———— We have looked through the entire list of service objects
- //———— and have not found one which handles this request type, so
- //———— return false to V.U.
- pReq->SetReturnValue( false );
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::GetToolName
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::GetToolName( char* pText )
- {
- strcpy( pText, (char*)gTheApplication->fProcessName );
- p2cstr( (StringPtr)pText );
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::GetToolVersionString
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::GetToolVersionString( char* pText )
- {
- VersResRecHdl tVers;
- short tLength;
- short i;
- char* s;
- char* d;
-
- tVers = (VersResRecHdl)Get1Resource( 'vers', 1 );
- if( tVers )
- {
- HLock( (Handle)tVers );
-
- //———— Set s to point at the length byte of the short version string
- s = (*tVers)->versStr;
-
- //———— Advance s to the length byte of the long version string
- //———— which begins just after the short version string
- s += s[0] + 1;
-
- //———— Get the length of the long version string
- tLength = s[0];
-
- //———— Copy the long version string into pText
- d = pText;
- s++;
- for( i = 0; i < tLength; i++ )
- {
- *d++ = *s++;
- }
- *d = 0; //———— Terminating Null character
-
- HUnlock( (Handle)tVers );
- ReleaseResource( (Handle)tVers );
- }
- else
- {
- strcpy( pText, "Version string not available." );
- }
- }
-
- //—————————————————————————————————————————————————————————————————————————————————————
- // RequestDispatcher::ResetAllTimeOutCounters
- //—————————————————————————————————————————————————————————————————————————————————————
- void
- RequestDispatcher::ResetAllTimeOutCounters()
- {
- Loop tLoop( fRequestQueue );
- Loop tALoop( fActiveRequestList );
- Request* tReq;
-
- tReq = (Request*)tLoop.GetNext();
- while( tReq )
- {
- tReq->ResetTimeOutCounter();
- tReq = (Request*)tLoop.GetNext();
- }
-
- /*SBR Hacked this in 10/16/94 */
- tReq = (Request*)tALoop.GetNext();
- while( tReq )
- {
- //———— Use the timeout value defined in the custom Service object
- tReq->ResetTimeOutCounter( tReq->GetService()->GetTimeOutInterval() );
- tReq = (Request*)tALoop.GetNext();
- }
- }
-
- /*SBR Hacked this in 10/16/94 */
- //—————————————————————————————————————————————————————————————————————————————————————
- // ServiceProcessRequestThread
- //—————————————————————————————————————————————————————————————————————————————————————
- void*
- ServiceProcessRequestThread( Request* pReq )
- {
- Service* tService;
-
- tService = pReq->GetService();
- tService->ProcessRequest( pReq );
-
- gTheRequestDispatcher->RequestIsDone( pReq );
-
- return nil; //———— thread is disposed when this function returns
- }
-
-